[][src]Crate miniz_oxide_c_api

Crate wrapping miniz_oxide in a C API that mimics the C API of the original miniz. Originally designed to allow use of miniz_oxide as a back-end to the flate2 crate.

The C API is in a bit of a rough shape currently.

Modules

lib_oxide

This module mainly contains functionality replicating the miniz higher level API.

Macros

unmangle

Unmangle the wrapped functions if no_c_export is not defined. For benchmarks, and other comparisons where we want to have both the miniz and miniz_oxide functions available, functions shouldn not be marked no_mangle since that will cause conflicts.

Structs

mz_stream

Inner stream state containing pointers to the used buffers and internal state.

tdefl_compressor

Main compression struct. Not the same as CompressorOxide

tinfl_decompressor

Main decompression struct.

Enums

CAPICompressionStrategy
CAPIFlush

Deflate flush modes.

CAPIReturnStatus
MZError

A list of miniz failed status codes.

MZFlush

A list of flush types.

MZStatus

A list of miniz successful status codes.

Constants

MZ_CRC32_INIT
MZ_DEFAULT_WINDOW_BITS
MZ_DEFLATED

Functions

miniz_def_alloc_func

Default allocation function using malloc.

miniz_def_free_func

Default free function using free.

miniz_def_realloc_func
mz_adler32

Calculate adler32 checksum of the provided buffer with the initial adler32 checksum of adler. If c_ulong is wider than 32 bits, only the lower 32 bits will be used.

mz_compress
mz_compress2
mz_compressBound
mz_crc32_oxide
mz_crc32

Calculate crc-32 of the provided buffer with the initial CRC32 checksum of crc. If c_ulong is wider than 32 bits, only the lower 32 bits will be used.

mz_deflate
mz_deflateBound
mz_deflateEnd
mz_deflateInit
mz_deflateInit2
mz_deflateReset
mz_inflate
mz_inflateEnd
mz_inflateInit
mz_inflateInit2
mz_uncompress
tdefl_allocate

Allocate a compressor.

tdefl_compress
tdefl_compress_buffer
tdefl_compress_mem_to_heap
tdefl_compress_mem_to_mem
tdefl_compress_mem_to_output
tdefl_create_comp_flags_from_zip_params
tdefl_deallocate

Deallocate the compressor. (Does nothing if the argument is null).

tdefl_get_adler32
tdefl_get_prev_return_status
tdefl_init

Initialize the compressor struct in the space pointed to by d. if d is null, an error is returned.

tinfl_decompress
tinfl_decompress_mem_to_heap

Decompress data from p_src_buf to a continuously growing heap-allocated buffer.

tinfl_decompress_mem_to_mem

Type Definitions

MZResult

Result alias for all miniz status codes both successful and failed.

mz_alloc_func

Signature of function used to allocate the compressor/decompressor structs.

mz_free_func

Signature of function used to free the compressor/decompressor structs.